
#coding=utf-8
import json
import requests

# 引入自定义的keystone模块
import keystone
keystone_s=keystone.getToken()

#端点地址：
subnetwork_url="http://192.168.100.10:9696/v2.0/subnets"
#定义请求头
headers={
    "X-Auth-Token":keystone_s['token']
}
#发送请求
req=requests.get(subnetwork_url,headers=headers)
#格式化打印响应
print(json.dumps(req.json(),sort_keys=True,indent=4))


